package com.gitee.wsl.ext.any

inline  fun <reified T> T?.or(default: T) = this ?: default

inline fun <reified T> T?.nullSet(setValue:()->T):T{
    return this?: setValue()
}

inline  fun <reified T> Any?.ifNullValue(nullValue:T,value:T):T{
    return if(this==null) nullValue else value
}

/**
 * Takes this object if it is not the [default], otherwise takes the [other] object.
 */
fun <T> T.safeTake(other: T, default: T): T = if (this != default) this else other




